package javagame;

public abstract class Alarm implements Runnable {
    long time;
    
    public Alarm(long ms) {
        time = ms;
        (new Thread(this)).start();
    }
    
    public void run() {
        try {
            Thread.sleep(time);
        } catch(InterruptedException e) {
            //
        }
        event();
    }
    
    public abstract void event();
}